import React from 'react'
import { hideCode } from '@/utils/utils';
import './index.less';
import male from '@/assets/images/male.png'
import female from '@/assets/images/female.png'

interface IUserProps {
  /**
   * 用户名
   */
  userName: string;
  /**
   * 身份证号
   */
  idCard: string;
}
const User: React.FC<IUserProps> = (props) => {
  const { userName='', idCard='' } = props
  const imgSrc = Number(idCard.slice(-2,-1)) % 2 === 0 ? female : male
  return (
    <div className='user_container'>
      <img src={imgSrc} alt="img"/>
      <div className='text'>
        <p>{userName}</p>
        <p className='p2'>{hideCode(idCard,6,4)}</p>
      </div>
    </div>
  )
}
export default User;
